<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
	 <meta charset="UTF-8">
	 <title th:replace="common/base::pagetitle"></title>
	 <link th:replace="common/base::static"/>
</head>
<body>
<div id="kPage" class="layui-fluid" style="padding: 0">
	 <div class="layui-card-body">
		<table id="signers" lay-filter="signers"></table>
	 </div>
</div>
<script type="text/html" id="orgIdTpl">
	 {{# if(d.orgId != null && d.orgId.length > 0){ }}
		  {{# var data = wlbKit.get(api.sys.getDept + d.orgId).data; }}
		  {{# return data ? data.name : '<span class="layui-badge-rim">未分配</span>'; }}
	 {{#  } else { }}
	 	<span class="layui-badge-rim">未分配</span>
	 {{# } }}
</script>
<script th:replace="common/base::context"></script>
<script th:replace="common/base::mainjs"></script>
<script th:src="@{/static/js/select-tree.js}"></script>
<script th:inline="none">
    layui.use(['form', 'table'], function () {
        var table = layui.table;
        var flowId = wlbKit.getUrlParam('flowId');
        var tableId = 'signers';
        var tableIns = table.render($.extend(config.layui.table, {
            elem: '#' + tableId
            , url: BASE_WEB + 'esign/query/getSigners?flowId=' + flowId //数据接口
            , cols: [
                [
                    {field: 'signerAccountId', title: '签署人账号', width:240, fixed: 'left'}
                    ,{field: 'orgId', title: '签署人所属机构', width:80, templet: '#orgIdTpl'}
						  ,{field: 'signOrder', title: '签署顺序', sort: true, width:110}
						  ,{field: 'signerName', title: '签署人名称', width:150, sort: true}
						  ,{field: 'signerRealName', title: '签署人是否已实名', width:80}
                    ,{field: 'signStatus', title: '签署状态', width:80, templet: function (d){
                        if (d.signStatus != null){
                            if(d.signStatus == 0){
                                return '待签';
									 }else if(d.signStatus == 1){
                                return '未签';
									 }else if(d.signStatus == 2){
                                return '已签';
                            }else if(d.signStatus == 3){
                                return '待审批';
                            }else if(d.signStatus == 4){
                                return '拒签';
                            }
                          
                        }else{
                            return '<span class="layui-badge-rim">未知</span>';
                        }
                    }}
						  ,{field: 'signerAuthorizedAccountId', title: '签约主体的账号id', width: 240}
						  ,{field: 'signerAuthorizedAccountName', title: '签约主体名称', width: 180}
						  ,{field: 'signerAuthorizedAccountType', title: '签署主体类型', width: 180}
            	]
				]
        }));
    })
</script>
</body>
</html>